/**
 * FileName: MainApp.java
 * @Description: TODO(用一句话描述该文件做什么)
 * All rights Reserved, Designed By 21winmess
 * Copyright: Copyright(C) 2010-2011 
 * Company 21winmess DaLian LTD.
 * @author: Matrix xu
 * @version V2.0
 * Createdate: 2012-11-22 上午11:11:02
 *
 * Modification History:
 * Date Author Version Discription
 * -----------------------------------------------------------------------------------
 * 2012-11-22 Qute_Android2.0
 * Why & What is modified: <修改原因描述>
 */
package com.me.safebox.ui;

import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;

import net.tsz.afinal.FinalBitmap;
import android.app.Application;
import android.content.Context;
import android.widget.Toast;

import com.me.safebox.R;
import com.me.safebox.service.FileConfig;
import com.me.safebox.utils.FileHelper;

/**
 * @ClassName: MainApp
 * @Description:TODO(这里用一句话描述这个类的作用)
 * @author: Matrix
 * @date: 2012-11-22 上午11:11:02
 * 
 */
public class MainApp extends Application {

	private static FinalBitmap mFinalBitmap = null;

	public static Context context = null;

	/*
	 * (non-Javadoc)
	 * 
	 * @see android.app.Application#onCreate()
	 */
	@Override
	public void onCreate() {
		super.onCreate();
		context = getApplicationContext();
		mFinalBitmap = FinalBitmap.create(this);// 必须调用init初始化FinalBitmap模块
		mFinalBitmap.configLoadfailImage(R.drawable.unvaliable_image);
		FileHelper.createSourceFolder(FileConfig.FILE_TYPE_IMAGE);// 创建加密文件资源文件夹，包括内置外置SD卡的创建策略
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see android.app.Application#onTerminate()
	 */
	@Override
	public void onTerminate() {
		// TODO Auto-generated method stub
		super.onTerminate();
	}

	public static FinalBitmap getFinalBitmap() {
		return mFinalBitmap;
	}

	public Context getContext() {
		return getApplicationContext();
	}
}
